import { BasicColumn, FormSchema } from '@/components/Table';
import { h, ref } from 'vue';
import { Tag } from 'ant-design-vue';
import {VxeFormItemProps, VxeGridPropTypes} from "@/components/VxeTable";
import util from "@/utils/util";
import {deptSelectList, shelfSelectList} from '@/api/sys/iot';


/**
 */
export const vxeTableColumns: VxeGridPropTypes.Columns = [
  {
    title: '标签编号',
    field: 'tagNo',
    showOverflow: 'title',
    align: 'center',
    width: 130,
  },
  {
    title: '标签型号',
    field: 'tagType',
    showOverflow: 'title',
    width: 130,
    align: 'center',
  },
  {
    title: '标签MAC',
    field: 'tagMac',
    align: 'center',
  },
  {
    title: '部门名称',
    field: 'deptName',
    align: 'center',
    width: 120,
  },
  {
    title: '备注',
    field: 'remark',
    align: 'center',
    width: 120,
  },

  {
    title: '创建时间',
    field: 'createTime',
    width: 130,
    align: 'center',
  },

  // {
  //   width: 120,
  //   title: '操作',
  //   align: 'center',
  //   field: '',
  //   slots: { default: 'action' },
  //   fixed: 'right',
  // },
];




export const vxeTableFormSchema: VxeFormItemProps[] = [
  {
    span: 5,
    field: 'tagNo',
    title: '标签编号',
    itemRender: {
      props: {
        placeholder: '请输入',
      },
      name: 'AInput',
    },
  },

  {
    span: 5,
    itemRender: {
      name: 'VxeButtonGroup',
      options: [
        { type: 'reset', content: '重置' },
        { type: 'submit', content: '查询', status: 'primary' },
      ],
    },
  },
];


export const formSchema: FormSchema[] = [

  {
    field: 'tagNo',
    label: '标签编号',
    component:"Input",
    required: true,
  },
  {
    field: 'tagType',
    label: '标签型号',
    component:"Input",
    required: true,
  },

  {
    field: 'tagMac',
    label: '标签MAC',
    component:"Input",
    required: true,
  },
  {
    field: 'deptId',
    label: '部门',
    component:"ApiSelect",
    componentProps: {
      api: deptSelectList,
      // mode:"multiple",
      resultField:"data",
      labelField: 'deptName',
      valueField: 'deptId',
    },
    required: true,
  },
  {
    field: 'shelfId',
    label: '架子',
    component:"ApiSelect",
    componentProps: {
      api: shelfSelectList,
      // mode:"multiple",
      resultField:"data",
      labelField: 'shelfName',
      valueField: 'shelfId',
    },
    required: true,
  },
  {
    field: 'remark',
    label: '备注',
    component:"Input",
    required: false,
  },

];
